﻿@*
//------------------------------------------------------------------------------
//  此代码版权声明为全文件覆盖，如有原作者特别声明，会在下方手动补充
//  此代码版权（除特别声明外的代码）归作者本人Diego所有
//  源代码使用协议遵循本仓库的开源协议及附加协议
//  Gitee源代码仓库：https://gitee.com/diego2098/ThingsGateway
//  Github源代码仓库：https://github.com/kimdiego2098/ThingsGateway
//  使用文档：https://diego2098.gitee.io/thingsgateway-docs/
//  QQ群：605534569
//------------------------------------------------------------------------------
*@

@inject NavigationManager NavigationManager
@namespace ThingsGateway.Admin.Blazor.Core
@inject UserResoures UserResoures;
@inherits BaseComponentBase
@using BlazorComponent;
@using Masa.Blazor;


<div class="ml-16">
    <MMenu OffsetY Bottom Right CloseOnContentClick="true" @bind-Value="_open" MinWidth="@("auto")">
        <ActivatorContent>
            <MTooltip Color="primary" Bottom>
                <ActivatorContent Context="tooltipContext">
                    @{
                        var attrs = new Dictionary<string, object>();
                        foreach (var (key, value) in context.Attrs)
                        {
                            attrs.Add(key, value);
                        }
                        foreach (var (key, value) in tooltipContext.Attrs)
                        {
                            if (attrs.ContainsKey(key) is false) attrs.Add(key, value);
                        }
                    }
                    <MIcon @attributes="@attrs" Size=20 Color="dark-yellow">mdi-star-outline</MIcon>
                </ActivatorContent>
                <ChildContent>
                    <span>收藏</span>
                </ChildContent>
            </MTooltip>
        </ActivatorContent>
        <ChildContent>
            <MList Class="pb-1" Style="min-width:320px;">
                @foreach (var nav in UserResoures.WorkbenchOutputs)
                {
                    <MListItem Dense OnClick="()=> NavigationManager.NavigateTo(nav.Component)" Class="px-4">
                        <MListItemAction Class="mr-3">
                            <MIcon Size=20 Color="neutral-lighten-3">@nav.Icon</MIcon>
                        </MListItemAction>
                        <MListItemContent>
                            <span Class="text-btn">@(nav.Title)</span>
                        </MListItemContent>
                    </MListItem>
                }
            </MList>
        </ChildContent>
    </MMenu>
</div>
